﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default2 : System.Web.UI.Page
{
    clsUser objUser = new clsUser();
    HttpCookie CookieID;
    string pageName = "Password ";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.Cookies["CookieUserID"] != null)
            {
                CookieID = Request.Cookies["CookieUserID"];
                lblUserNameOrEmailText.Text = "Username:";
            }
            lblUserNameOrEmailContent.Text = CookieID["Username"];
            objUser.ID = Convert.ToInt32(CookieID["ID"]);
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int UserType = 2;
        if (objUser.PasswordChange(objUser.ID, lblUserNameOrEmailContent.Text, txtNewPassword.Text, "", txtOldPassword.Text, UserType))
            litErrorListMsg.Text = "Password Changed Successfully";
        else
            litErrorListMsg.Text = "Password does not match ";
    }
}